package pers.chao.tool.validate;

import pers.chao.tool.infrastructure.regex.RegexPattern;

/**
 * Description: 常用验证器
 *
 * @author W.Chao
 * @date 2020/11/11 23:35
 **/
public interface Validators<T> {
	boolean validate(T t);

	Validators<String> MOBILE_SIMPLE = RegexPattern::isMobileSimple;

	Validators<String> MOBILE_EXACT = RegexPattern::isMobileExact;

	Validators<String> TEL = RegexPattern::isTel;

	Validators<String> ID_CARD15 = RegexPattern::isIDCard15;

	Validators<String> ID_CARD18 = RegexPattern::isIDCard18;

	Validators<String> EMAIL = RegexPattern::isEmail;

	Validators<String> URL = RegexPattern::isURL;

	Validators<String> ZH = RegexPattern::isZh;

	// 用户名，取值范围为a-z,A-Z,0-9,"_",汉字，不能以"_"结尾,用户名必须是6-20位
	Validators<String> USERNAME = RegexPattern::isUsername;

	Validators<String> IP = RegexPattern::isIP;

	Validators<String> ONLY_NUMBER = RegexPattern::isNumeric;

	Validators<String> ONLY_LETTER = RegexPattern::isLetter;

	Validators<String> NUMBER_AND_LETTER = RegexPattern::isLetterAndNum;
}
